#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;

// 高精度加法
string add(string a, string b) {
	string result = "";
	int carry = 0;
	int i = a.length() - 1;
	int j = b.length() - 1;
	
	while (i >= 0 || j >= 0 || carry) {
		int sum = carry;
		if (i >= 0) sum += a[i--] - '0';
		if (j >= 0) sum += b[j--] - '0';
		carry = sum / 10;
		result.push_back((sum % 10) + '0');
	}
	
	reverse(result.begin(), result.end());
	return result;
}

// 高精度乘法
string multiply(string a, string b) {
	if (a == "0" || b == "0") return "0";
	
	int m = a.length(), n = b.length();
	string result(m + n, '0');
	
	for (int i = m - 1; i >= 0; i--) {
		for (int j = n - 1; j >= 0; j--) {
			int mul = (a[i] - '0') * (b[j] - '0');
			int sum = mul + (result[i + j + 1] - '0');
			result[i + j + 1] = (sum % 10) + '0';
			result[i + j] += sum / 10;
		}
	}
	
	// 去除前导零
	result.erase(0, result.find_first_not_of('0'));
	return result.empty() ? "0" : result;
}

//int main() {
//	string a, b;
//	cout << "请输入两个大整数: ";
//	cin >> a >> b;
//	
//	cout << "加法结果: " << add(a, b) << endl;
//	cout << "乘法结果: " << multiply(a, b) << endl;
//	
//	return 0;
//}

int main() {
	freopen("hanoi.in","r",stdin);
	freopen("hanoi.out","w",stdout);
	int n;
	cin >> n;
	//long n1=1, n2=2;
	string n1("1"), n2("0");
	for(int i=1; i<n; ++i) {
		//n2 = 2*n1+1;
		n2 = add("1", multiply("2", n1));
		n1 = n2;
	}
	cout << multiply(n2, "2") << endl;
}
